package jp.dodododo.dao.util;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 
 * @author Satoshi Kimura
 */
public abstract class CollectionOfString {
	public static Map<String, Object> map(Object... map) {
		Map<String, Object> ret = new HashMap<String, Object>();
		for (int i = 0; i < map.length; i += 2) {
			if (map.length <= i + 1) {
				ret.put(null, map[i]);
				break;
			}
			String key = map[i].toString();
			Object value = map[i + 1];
			ret.put(key, value);
		}
		return ret;
	}

	public static List<String> list(String... list) {
		List<String> ret = new ArrayList<String>();
		for (int i = 0; i < list.length; i++) {
			String value = list[i];
			ret.add(value);
		}
		return ret;
	}
}
